<%-- 
    Document   : mostraImovel
    Created on : 21/03/2011, 14:36:51
    Author     : cristiane
--%>

<%@page import="model.Imovel"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page import="java.net.URLEncoder"%>
<%@page contentType="text/html" pageEncoding="UTF-8" language="java"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<!--<%request.setCharacterEncoding("UTF-8");
String cidadeEncoded = URLEncoder.encode(request.getParameter("cidade"), "UTF-8");
Cookie cookieCidade = new Cookie("cidade", cidadeEncoded);
response.addCookie(cookieCidade);
String bairroEncoded = URLEncoder.encode(request.getParameter("bairro"), "UTF-8");
Cookie cookieBairro = new Cookie("bairro", bairroEncoded);
response.addCookie(cookieBairro);
%>-->

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Im&oacute;veis Encontrados</title>
    </head>
    <body background="imagens/background2.gif">
        <div id="geral">
            <div id="header">
        <jsp:include page="header.jsp" />
            </div>
            <p>
            <div id="body">
        <jsp:useBean id="imovel" scope="session" class="model.Imovel" />
        <font size="4">
        <table style="text-align: left; width: 80%" align="center" cellspacing="2" cellpadding="2" border="1">
            <tbody>
            <tr>
                <td style="vertical-align: top; text-align: center;" colspan="2">
                    <h1>Imoveis encontrados</h1>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top; text-align: center">C&oacute;digo</td>
                <td style="vertical-align: top; text-align: center">Tipo de Negocio</td>
                <td style="vertical-align: top; text-align: center">Tipo de Im&oacute;vel</td>
                <td style="vertical-align: top; text-align: center">Quartos</td>
                <td style="vertical-align: top; text-align: center">Endereco</td>
                <td style="vertical-align: top; text-align: center">Cidade</td>
                <td style="vertical-align: top; text-align: center">Estado</td>
                <td style="vertical-align: top; text-align: center">Preco</td>

            </tr>
            <%List listaImoveis = (List)request.getAttribute("listaLivros");
              for(Iterator i = listaImoveis.iterator(); i.hasNext();){
                  Imovel im = (Imovel)i.next();
            %>
            <tr>
                <td style="vertical-align: top; text-align: center">
                    <a href="ImobiliariaServlet?cmd=procurarImovel&codigo=<%=im.getCodigo()%>"><%=im.getCodigo()%></a>
                </td>
                <td style="vertical-align: top; text-align: center">
                    <%=im.getTipo_negocio()%>
                </td>
                <td style="vertical-align: top; text-align: center">
                    <%=im.getTipo()%>
                </td>
                <td style="vertical-align: top; text-align: center">
                    <%=im.getQuartos()%>
                </td>
                <td style="vertical-align: top; text-align: center">
                    <%=im.getRua()%> <%=im.getNumero()%>
                    <%if(im.getComplemento() != null){%>
                       <%=(im.getComplemento())%>
                  <% } %>
                  <%=im.getBairro()%>
                </td>
                <td style="vertical-align: top; text-align: center">
                    <%=im.getCidade()%>
                </td>
                <td style="vertical-align: top; text-align: center">
                    <%=im.getEstado()%>
                </td>
            </tr>
            <% } %>
            </tbody>
        </table>
        </font>
            </div>
            <p>
            <div id="footer">
            <jsp:include page="footer.jsp" />
            </div>
        </div>
    </body>
</html>


